package com.douqu.game.core.entity.world.map;

import com.douqu.game.core.entity.EntityObject;
import com.douqu.game.core.entity.Player;
import com.douqu.game.core.protobuf.SGCommonProto;

/**
 * @Author: Bean
 * @Description:
 * @Date: 2018-07-12 18:25
 */
public class PlayerBaseInfo extends EntityObject {

    /**
     * baseInfo.setPlayerIndex(player.objectIndex);
     baseInfo.setNickName(player.name);
     baseInfo.setAvatar(player.avatar);
     baseInfo.setFc(player.fc);
     baseInfo.setVipLv(player.getVipLevel());
     baseInfo.setCamptypeValue(player.camp);
     baseInfo.setLv(player.getLv());
     */

    private String objectIndex = "";

    private String nickName = "";

    private String avatar = "";

    private int fc;

    private int vipLv;

    private int camp;

    private int lv;

    public SGCommonProto.PlayerBaseInfo.Builder parseBaseInfo()
    {
        SGCommonProto.PlayerBaseInfo.Builder baseInfo = SGCommonProto.PlayerBaseInfo.newBuilder();
        baseInfo.setPlayerIndex(objectIndex);
        baseInfo.setNickName(nickName);
        baseInfo.setAvatar(avatar);
        baseInfo.setFc(fc);
        baseInfo.setVipLv(vipLv);
        baseInfo.setCamptypeValue(camp);
        baseInfo.setLv(lv);

        return baseInfo;
    }

    public void update(Player player)
    {
        this.objectIndex = player.getObjectIndex();
        this.avatar = player.avatar;
        this.nickName = player.name;
        this.fc = player.fc;
        this.lv = player.getLv();
        this.vipLv = player.getVipLevel();
        this.camp = player.camp;
    }

    public String getObjectIndex() {
        return objectIndex;
    }

    public void setObjectIndex(String objectIndex) {
        this.objectIndex = objectIndex;
    }

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    public int getFc() {
        return fc;
    }

    public void setFc(int fc) {
        this.fc = fc;
    }

    public int getVipLv() {
        return vipLv;
    }

    public void setVipLv(int vipLv) {
        this.vipLv = vipLv;
    }

    public int getCamp() {
        return camp;
    }

    public void setCamp(int camp) {
        this.camp = camp;
    }

    public int getLv() {
        return lv;
    }

    public void setLv(int lv) {
        this.lv = lv;
    }

    @Override
    public String toString() {
        return "{" +
                "objectIndex='" + objectIndex + '\'' +
                ", nickName='" + nickName + '\'' +
                ", avatar='" + avatar + '\'' +
                ", fc=" + fc +
                ", vipLv=" + vipLv +
                ", camp=" + camp +
                ", lv=" + lv +
                "} ";
    }
}
